/**
 * Author: Dmitry Ustimov
 * Date: 5/11/13
 * Time: 10:01 PM
 */

package com.gmail.dmitryustimov.ms.java7.composite.mod.work.demo.structure1_6_9_6;

import com.gmail.dmitryustimov.ms.java7.patternslib.composite.Component;

import java.math.BigDecimal;

public class Leaf extends Component {

    private String name;
    private BigDecimal sum = BigDecimal.valueOf(0);

    public Leaf(String name) {
        super();
        this.name = name;
    }

    public boolean isComposite() {
        return false;
    }

    @Override
    public void doAction() {
        sum.add(BigDecimal.valueOf(1));
    }
}
